package lab02.test04;
//定义增长的工资，总工资
public class GrowthSalary extends   Employee {
    private  double growthsalary ;
    private  int hour;

    public  GrowthSalary(String name,String number,float salary,int hour){
        super(name, number, salary);
    }
      public  void setHour(int hour){
        this.hour  = hour;
      }
    public int getHour(){
          return hour;
    }

    public void setGrowthsalary(double growthsalary) {
        this.growthsalary = growthsalary;
    }
//按一个月工作160个小时计算，超过的就算增加的工资计算
    public double getGrowthsalary() {
       /* double growthsalary;*/
        if( hour >= 160){
            growthsalary = (hour-160)*15;
        }
        else {
            return 0;
        }
        return growthsalary;
    }

}

